# -*- coding: utf-8 -*-
# -*- frozen_string_literal: true -*-

require "<%= @scaffold.gem_path %>/manifest"

class <%= @scaffold.main_namespace %>
<%= "  module " + @scaffold.plugin_namespace if @scaffold.plugin_namespace %>
  # Aimed at gemspec, and supported doc generators.
  module Doc
    # One line summary of what <%= @scaffold.namespace %> is.
  def self.summary
  "<%= @scaffold.formatted_name %>'s summary"
  end

  # Short description of what <%= @scaffold.namespace %> does, and how does it do it.
  def self.description
  <<~EOH
  <%= @scaffold.formatted_name %>'s description
  EOH
  end

  # Array of options used for building the documentation.
  def self.build_options
      [
        "--line-numbers",
        "--title", "#{Manifest.official_name}: #{self.summary}",
        "--main", "ReadMe.md"
      ]
    end

    # Array of documented files. These should be listed in Manifest.md.
    def self.files
      <%= @scaffold.namespace %>::Manifest.files.select { |f|
      <%= @scaffold.namespace %>::Manifest.codebase.any? { |dir| f.start_with? dir }
      }
    end

    # Array of extra doc files. These should be listed in Manifest.md.
    def self.appendices
      <%= @scaffold.namespace %>::Manifest.files.select { |f| f.end_with? ".md" }
      end
  end
  <%= "  end" if @scaffold.plugin_namespace %>
end
